<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="http://1stjs.googlecode.com/svn/trunk/fw4/" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="1st.js"></script>
<style type="text/css">
button.ico {
    background-color: transparent;
    background-position: 0 0;
    background-repeat: no-repeat;
    border: 0 none;
    height: 26px;
    margin: -5px 10px 0 0;
    padding: 0;
    vertical-align: middle;
    width: 26px;
	cursor: pointer;
}
button.ico.addNode {
    background: url(data/img/icon/addNode.png) no-repeat scroll 0 0 transparent;
}
button.ico.removeNode {
    background: url(data/img/icon/removeNode.png) no-repeat scroll 0 0 transparent;
}
</style>
<title>树演示</title>
</head>

<body>
<ul id="digital_tree" style="width:200px;"></ul>

<ul class="operate">
	修改节点名称: <input value="" id="renameTxt" onchange="tree.getNode(2,0).edit(this.value);" type="text">
</ul>

<ul class="operate">
	增加叶子节点: <input /><button class="ico addNode" onfocus="this.blur();" title="增加叶子节点" onclick="tree.getNode(2).add({key:this.previousSibling.value});"></button>
	<br />
	删除节点: <button class="ico removeNode" onfocus="this.blur();" title="删除节点" onclick="tree.getNode(2,2).del();"></button>
</ul>

<script type="text/javascript">
var node;

var settings = {
	title:"数码列表",
	key:"name",
	items:"nodes",
	//itemIcon:"/images/icon/user/male.gif",
	itemClick:function(o){
		window.alert("您选择了："+o.name);
	}
};

var tree = F.tree("digital_tree", F.data("json/stand_tree.js"), settings);
</script>

</body>
</html>
